<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" />
    <title>{$Img.name}--菜品列表</title>
    <link href="__CSS_USER_PATH__/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="__JS_PATH__/jquery-1.8.3-all.js"></script>
    <script type="text/javascript" src="__JS_PATH__/alert/jquery.ui.draggable.js"></script>
    <script type="text/javascript" src="__JS_PATH__/alert/jquery.alerts.js"></script>
    <link href="__JS_PATH__/alert/jquery.alerts.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript">
        $(function(){

                $('#checkOut').click(function(){
                    $.post(
                            'index.php?g=User&m=Index&a=checkOut',
                            {
                                'test':'test'
                            },
                            function(data){
                                if(data==1){
                                    jConfirm('确认要结账么？', 'wifi管家提示您', function(r) {
                                        if(r){
                                            $.post(
                                                    'index.php?g=User&m=Index&a=checkOut',
                                                    {},
                                                    function(d){
                                                        if(d==1){
                                                            jAlert('请等待管理员，前来结账', 'wifi管家提示您');
                                                        }else{
                                                            jAlert('结账失败，请联系服务人员', 'wifi管家提示您');
                                                        }
                                                    }
                                            )
                                        }
                                    });

                                }else if(data==3){
                                    jAlert('您还没有下订单，请先下订单', 'wifi管家提示您');
                                }else if(data==4){
                                    jAlert('您还没有点菜，请点菜', 'wifi管家提示您');
                                }else if(data==6){
                                    jAlert('您已经点击了结账', 'wifi管家提示您');
                                } else if(data==7){
                                    jAlert('请等待管理员处理菜单', 'wifi管家提示您');
                                }

                            }
                    )

                });







            var mak=$('.tagContent').children('div').length;
            for(i=1;i<=mak;i++){
                $('.dianCai'+i).click(function(){
                    var that=this;
                    jConfirm('确认要点菜么？', 'wifi管家提示您', function(mr) {
                        if(mr){

                    var par=$(that).parents('.ly_right');
                    var name=par.children('.name').val();
                    var price=par.children('.price').val();
                    var id=par.children('.id').val();
                    var tempId=par.children('.tempId').val();
                    var listId=par.children('.listId').val();
                    //alert(id);

                    var a=$('#menuNum', window.parent.document).text();
                    a=Number(a);
                    a+=1;
                    $('#menuNum', window.parent.document).text(a);

                    $.post(
                            'index.php?g=User&m=Index&a=addGreens',
                            {
                                'name':name,
                                'price':price,
                                'u_id':id,
                                'listId':listId,
                                'tempId':tempId
                            },
                            function(data){
                                if(data==1){
                                    jAlert('点菜成功', 'wifi管家提示您');

                                }
                            }
                    );
                        }
                    });
                });
            }
        });
    </script>
    <style type="text/css">
        <!--
        * {
            margin:0;
            padding:0;
        }
        body {line-height: 1;}
        ol, ul {list-style: none;}
        img { border:none;}
        a{ text-decoration:none; -webkit-tap-highlight-color:rgba(255,0,0,0);}
        #p_tou {
            width:98%;
            border-bottom:1px solid #ccc;
            line-height:30px;
            margin:5px auto 0;
            font-size:110%;
        }
        #p_tou span {
            display:block;
        }
        #p_tou .t_left {
            float:left;
        }
        #p_tou .t_right {
            float:right;
        }
        .caipin_list1 {
            width:98%;
            margin:0 auto;
            border-bottom:1px solid #ccc;
            padding:10px 0;
        }
        .caipin_list1 .ly_left {
            width:25%;
            float:left;
            margin-right:2%;
            position: relative;
        }
        .caipin_list1 .ly_left a {
            display:block;
            width:98%;
            border:1px solid #ccc;
            padding:2px 1%;
        }
        .caipin_list1 .ly_left a img {
            width:100%;
        }
        .ly_left .ly_hot {
            position:absolute;
            top:0;
            right:0;
        }
        .caipin_list1 .ly_center {
            width:42%;
            float:left;
            margin-right:2%;
        }
        .caipin_list1 .ly_center h2 {
            width:100%;
            line-height:35px;
            margin-bottom:10px;
        }
        .caipin_list1 .ly_center h2 a {
            color:#B71100;
            font-size:100%;
            font-weight:normal;
        }
        .caipin_list1 .ly_center span {
            line-height:25px;
        }
        .caipin_list1 .ly_right {
            width:25%;
            float:right;
            margin-right:2%;
        }
        .caipin_list1 .ly_right h3 {
            width:100%;
            color:#FFAF02;
            font-size:150%;
            line-height:35px;
        }
        .caipin_list1 .ly_right p {
            width:100%;
            border:none;
            margin-top:10px;
        }
        .caipin_list1 .ly_right p a img {
            width:35%;
        }


        -->
    </style>
</head>

<body>
<div id="pad_left">
    <div class="left_bg"><img src="__IMG_USER_PATH__/left_bg.png" /></div>
    <div class="ly_logo"><img src="{$Img.logo}" /></div>
    <div class="left_nav">
        <ul>
            <li><a target='_self' href="{:U(GROUP_NAME.'/Index/myMuenList')}" ><img src="__IMG_USER_PATH__/tb1.png" />我的菜单（<if condition="!isset($num)"><span id="menuNum">0</span></if><span id="menuNum">{$num}</span>份）</a></li>
            <li><a target='_self' href="{:U(GROUP_NAME.'/Index/newGreens')}" ><img src="__IMG_USER_PATH__/tb2.png" />新加菜品（10份）</a></li>
            <li><a  id="checkOut" ><img  src="__IMG_USER_PATH__/tb3.png" />结账</a></li>
        </ul>
    </div>
</div>
<div id="pad_right">
    <div id=con>

        <ul id=tags>
            <volist name='list' id='m'>
                <if condition='$i eq 1'>
                    <li class=selectTag><a onClick="selectTag('tagContent{$i-1}',this)" target='_self' href="{:U(GROUP_NAME.'/Index/menuList',array('menuid'=>$m['id']))}">{$m.name}</a></li>
                    <else />
                    <li><a onClick="selectTag('tagContent{$i-1}',this)" target='_self' href="{:U(GROUP_NAME.'/Index/menuList',array('menuid'=>$m['id']))}">{$m.name}</a></li>
                </if>
            </volist>
        </ul>
        <div id=tagContent>
            <div class="tagContent selectTag" >
                <p id="p_tou">
                    <span class="t_left">当前：{$listt}>>菜品列表</span>
                    <span class="t_right">用户:{$uname}&nbsp;&nbsp;&nbsp;&nbsp;桌号：{$tabNum}</span>
                    <span style="clear:both"></span>
                </p>
                <volist name="menu" id="v">
                    <div class="caipin_list1">

                        <div class="ly_left"><a  target="_self" href="{:U(GROUP_NAME.'/Index/green',array('id'=>$v['id'],'list'=>$listt))}"><img src="{$v.img}" /></a>
                            <if condition="$v['recommend'] eq 1"><img src="__IMG_USER_PATH__/hot.png" class="ly_hot" /></if>
                        </div>
                        <div class="ly_center">
                            <h2><a  href="{:U(GROUP_NAME.'/Index/green',array('id'=>$v['id'],'list'=>$listt))}">{$v.name}</a></h2>
                            <span>{$v.content|csubstr=0,100}</span>

                        </div>

                        <div class="ly_right">
                            <input type="hidden" class='id' value='{$v.id}' />
                            <input type="hidden" class='listId' value='{$v.menutypeid}' />

                            <input type="hidden" class='tempId' value='{$v.id}' />
                            <input type="hidden" class='name' value='{$v.name}' />
                            <input type="hidden" class='price' value='{$v.price}' />
                            <h3 >￥<span >{$v.price}</span>元/{$v.unit}</h3>
                            <p><a href="{:U(GROUP_NAME.'/Index/green',array('id'=>$v['id'],'list'=>$listt))}"><img src="__IMG_USER_PATH__/btn1.jpg" /></a>&nbsp;&nbsp;&nbsp;&nbsp;<img class='dianCai{$i}' src="__IMG_USER_PATH__/btn2.jpg" /></p>
                        </div>
                        <div style="clear:both"></div>
                    </div>
                </volist>
            </div>



    </DIV>
</div>

<SCRIPT type=text/javascript>
    function selectTag(showContent,selfObj){
        // 操作标签
        var tag = document.getElementById("tags").getElementsByTagName("li");
        var taglength = tag.length;
        for(i=0; i<taglength; i++){
            tag[i].className = "";
        }
        selfObj.parentNode.className = "selectTag";
        // 操作内容
    }

</SCRIPT>
</div>
<div id="ly_foot">
    <ul>
        <li><a href="{:U(GROUP_NAME.'/Index/menu')}" target="_self"><img src="__IMG_USER_PATH__/tb4.png" />菜单</a></li>
        <li><a href="{:U(GROUP_NAME.'/Index/hotMenu')}" target='_self'><img src="__IMG_USER_PATH__/tb5.png" />热门</a></li>
        <li><a href="{:U(GROUP_NAME.'/Index/tuijian')}" target='_self'><img src="__IMG_USER_PATH__/tb6.png" />推荐</a></li>
        <li><a href="{:U(GROUP_NAME.'/Index/myMuenList')}" target='_self' ><img src="__IMG_USER_PATH__/tb7.png" />已点</a></li>
        <li><a href="javascript:history.go(-1);"><img id='black' src="__IMG_USER_PATH__/tb8.png" />返回</a></li>
    </ul>
</div>
</body>
</html>
